//
//  DYLQFiledVC.m
//  PosApp
//
//  Created by 渴望 on 2019/3/25.
//  Copyright © 2019 李英新. All rights reserved.
//

#import "DYLQFiledVC.h"

@interface DYLQFiledVC ()
@property (nonatomic ,strong) UIButton * imgBtn;
@property (nonatomic ,strong) UILabel  * stateLab;
@property (nonatomic ,strong) UILabel  * stateLab1;
@property (nonatomic ,strong) UIButton * backBtn;
@property (nonatomic ,strong) UIButton * orderBtn;
@end

@implementation DYLQFiledVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)dy_initData{
    [super dy_initData];
    
}

- (void)dy_initUI{
    [super dy_initUI];
    self.title = @"支付订单";
    [self.view addSubview:self.imgBtn];
    [self.view addSubview:self.stateLab];
    [self.view addSubview:self.stateLab1];
    [self.view addSubview:self.backBtn];
    [self.view addSubview:self.orderBtn];
    
    [self layout];
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
- (void)layout{
    [self.imgBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        //        make.size.equalTo(CGSizeMake(KScreenW/2, KScreenW/2));
        make.width.equalTo(@(KScreenW/2));
        make.height.equalTo(@(KScreenW/2));
        make.top.equalTo(0);
        make.centerX.equalTo(self.view);
    }];
    [self.stateLab mas_makeConstraints:^(MASConstraintMaker *make) {
        [self.stateLab sizeToFit];
        make.centerX.equalTo(self.view);
        make.top.equalTo(self.imgBtn.mas_bottom).offset(10);
    }];
    [self.stateLab1 mas_makeConstraints:^(MASConstraintMaker *make) {
        [self.stateLab1 sizeToFit];
        make.centerX.equalTo(self.view);
        make.top.equalTo(self.stateLab.mas_bottom).offset(10);
    }];
    
    [self.orderBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@(KScreenW-40));
        make.height.equalTo(@(45));
        make.bottom.equalTo(@(-30));
        make.centerX.equalTo(self.view);
    }];
    [self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@(KScreenW-40));
        make.height.equalTo(@(45));
        make.bottom.equalTo(self.orderBtn.mas_top).offset(-10);
        make.centerX.equalTo(self.view);
    }];
}

- (UIButton *)imgBtn{
    if (!_imgBtn) {
        _imgBtn = [[UIButton alloc]init];
        [_imgBtn setImage:[UIImage imageNamed:@"failedbuy"] forState:UIControlStateNormal];
    }
    return _imgBtn;
}
- (UILabel *)stateLab{
    if (!_stateLab) {
        _stateLab = [[UILabel alloc]init];
        _stateLab.font = XHQ_FONT(30);
        _stateLab.textColor = XHQHexColor(0xF07425);
        _stateLab.text = @"付款失败";
    }
    return _stateLab;
}
- (UILabel *)stateLab1{
    if (!_stateLab1) {
        _stateLab1 = [[UILabel alloc]init];
        _stateLab1.font = XHQ_FONT(30);
        _stateLab1.textColor = XHQHexColor(0xF07425);
        _stateLab1.text = @"很遗憾，您没有付款成功!";
    }
    return _stateLab1;
}

- (UIButton *)orderBtn{
    if (!_orderBtn) {
        _orderBtn = [[UIButton alloc]init];
        [_orderBtn setBackgroundImage:[UIImage imageNamed:@"btn_back_k"] forState:UIControlStateNormal];
        _orderBtn.titleLabel.font = XHQ_FONT(15);
        [_orderBtn setTitle:@"重试" forState:UIControlStateNormal];
        [_orderBtn setTitleColor:XHQHexColor(0xF07425) forState:UIControlStateNormal];
        [_orderBtn addTarget:self action:@selector(orderBtnClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return _orderBtn;
}
- (UIButton *)backBtn{
    if (!_backBtn) {
        _backBtn = [[UIButton alloc]init];
        [_backBtn setBackgroundImage:[UIImage imageNamed:@"btn_back_ccc"] forState:UIControlStateNormal];
        _backBtn.titleLabel.font = XHQ_FONT(15);
        [_backBtn setTitle:@"回到订单" forState:UIControlStateNormal];
        [_backBtn addTarget:self action:@selector(orderBtnClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return _backBtn;
}

- (void)orderBtnClick{
    [self.navigationController popViewControllerAnimated:YES];
}

@end
